using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class WeaponExplorerItem : MonoBehaviour
{
    public Image m_Preview;
    public Text m_NameL;
    public Text m_TypeIDL;
    public Weapon m_Weapon;
    public WeaponExplorerList m_ExplorerList;
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        
    }

    public void Init(Weapon weapon)
    {
        m_TypeIDL.gameObject.SetActive(Main.m_GM.m_DevelopmentMode);
        m_Weapon = weapon;
        m_NameL.text = m_Weapon.name;
        m_TypeIDL.text = m_Weapon.typeID.ToString();
        m_Preview.sprite = ResourcesManager.Instance.GetWeaponSprite(weapon.typeID);

    }
    public void OnOpenToBlueprint()
    {
        m_ExplorerList.OnWeaponItemOpenByBlueprintClicked(m_Weapon); 
    }
    public void OnDeleteClicked()
    {
        m_ExplorerList.OnWeaponDeleteClicked(m_Weapon);
    }
}
